package com.wuye.basic.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wuye.basic.domain.WyHome;
import com.wuye.charge.domain.WyCostMake;
import org.apache.ibatis.annotations.*;

/**
 * 房间资料Mapper接口
 * 
 * @author jack
 * @date 2024-11-26
 */
@Mapper
public interface WyHomeMapper extends BaseMapper<WyHome>
{
    /**
     * 查询房间资料
     * 
     * @param homeId 房间资料主键
     * @return 房间资料
     */
    public WyHome selectWyHomeByHomeId(Long homeId);



    /**
     * 查询房间资料列表
     * 
     * @param wyHome 房间资料
     * @return 房间资料集合
     */
    public List<WyHome> selectWyHomeList(WyHome wyHome);

    /**
     * 新增房间资料
     * 
     * @param wyHome 房间资料
     * @return 结果
     */
    public int insertWyHome(WyHome wyHome);

    /**
     * 修改房间资料
     * 
     * @param wyHome 房间资料
     * @return 结果
     */
    public int updateWyHome(WyHome wyHome);

    /**
     * 删除房间资料
     * 
     * @param homeId 房间资料主键
     * @return 结果
     */
    public int deleteWyHomeByHomeId(Long homeId);

    /**
     * 批量删除房间资料
     * 
     * @param homeIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWyHomeByHomeIds(Long[] homeIds);


    @Insert("insert into wy_homeandtype values (null,#{homeId},#{homeTypeId})")
    void insertWy_homeandtype(@Param("homeId") Long hId,@Param("homeTypeId") Long type);

    @Delete("delete from wy_homeandtype where homeId=#{id}")
    void deleteWyhomeandtype(Long homeId);

    @Select("select homeTypeId from wy_homeandtype where homeId=#{homeId}")
    List<Long> selectAllTypes(Long homeId);
}
